import React from 'react'
import ReactDOM from 'react-dom/client';
import {
  BrowserRouter as Router,
  Route,
  Switch,
  Redirect,
} from 'react-router-dom';

import './style.css'
import Home from './views/home'
import Myroutes from './views/myroutes'
import RedMyRoute from './views/red-my-route'
import LogIn from './views/log-in'
import Land from './views/land'
import Reviews from './views/reviews'
import AllRev from './views/all-rev'
import Profile from './views/profile'
import Map from './views/map'
import NotFound from './views/not-found'
import Register from "./views/register.jsx";
import Points from "./views/points.jsx";

const App = () => {
  return (
      <Router>
        <Switch>
          <Route component={Home} exact path="/home" />
          <Route component={Myroutes} exact path="/myroutes" />
          <Route component={RedMyRoute} exact path="/red-my-route" />
          <Route component={LogIn} exact path="/login" />
          <Route component={Register} exact path="/registration" />
          <Route component={Land} exact path="/" />
          <Route component={Reviews} exact path="/reviews" />
          <Route component={AllRev} exact path="/all-rev" />
          <Route component={AllRev} exact path="/allrev" />
          <Route component={Profile} exact path="/profile" />
          <Route component={Map} exact path="/map" />
          <Route component={NotFound} path="**" />
          <Route component={RedMyRoute} exact path="/review-edit/:reviewId" />
          <Route component={Points} exact path="/Points" />
          <Route component={Reviews} exact path="/reviews/:reviewId" />
          <Redirect to="**" />
        </Switch>
      </Router>
  )
}

const root = ReactDOM.createRoot(document.getElementById('app'))
root.render(<App />)
